﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microhard.Permission.Interface;
using Microhard.WarehouseInsp.Buz.Models;
using Microhard.WarehouseInsp.Buz.Interfaces;
using Microsoft.Practices.Unity;
using Microhard.Workflow;
using Microhard.WarehouseInsp.Buz.JHWorkflow;
using FluentValidation.Mvc;
using System.IO;
using Microhard.Permission.MVCFilter;
using Microhard.WebUI.Models;
using Microhard.Core;
using Microhard.Core.DBUtility;
using Telerik.Web.Mvc;


namespace Microhard.WarehouseInsp.WebUI.Areas.WarehouseInsp.Controllers
{
    public class InspectionRecordController : MicroHardBaseController<InspectionRecordModel>
    {
        private IInspectionRecord _resp = null;
        [Dependency]
        public IInspectionRecord Category
        {
            set
            {
                base._repository = value;
                _resp = value;
            }
            get
            {
                return _resp;
            }
        }

        [MVCFilterAtrForLogon()]
        public ActionResult GetPrjByProtal(AttributeOfWindow aowModel, ScopeResult scope)
        {
            ISupProject project = IoC.Resolve<ISupProject>();
            project.scope = scope;
            var p = project.GetSupProjectByProtal(scope.CurrentUserID);
            aowModel.Data = new GridModel()
            {
                Data = p,
                Total = p.Count
            };
            return View(aowModel);
        }


    }
}
